package cn.yxvk.spring.security.oauth2.resources.controller;

import cn.yxvk.spring.security.oauth2.resources.domain.TbContent;
import cn.yxvk.spring.security.oauth2.resources.dto.ResponseResult;
import cn.yxvk.spring.security.oauth2.resources.service.TbContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yangxiang
 * @date 2019/10/31 13:53
 */
@RestController
public class TbContentController {
    @Autowired
    private TbContentService tbContentService;

    @GetMapping("/")
    public ResponseResult<List<TbContent>> list(){
        return new ResponseResult<List<TbContent>>(HttpStatus.OK.value(),HttpStatus.OK.toString(),
                tbContentService.selectAll());
    }
}
